package com.nts.visionworks.business.contents.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * ContentsMediaThumbnail generated by hbm2java
 */
@Entity
@Table(name = "contents_media_thumbnail", catalog = "visionworks")
public class ContentsMediaThumbnail implements java.io.Serializable
{

	private ContentsMediaThumbnailId id;
	private ContentsMedia contentsMedia;
	private long archiveId;
	private String thumbnailDetails;
	private Set<ContentsDelegatedThumbnail> contentsDelegatedThumbnails = new HashSet<ContentsDelegatedThumbnail>(
			0);

	public ContentsMediaThumbnail()
	{
	}

	public ContentsMediaThumbnail(ContentsMediaThumbnailId id,
			ContentsMedia contentsMedia, long archiveId)
	{
		this.id = id;
		this.contentsMedia = contentsMedia;
		this.archiveId = archiveId;
	}

	public ContentsMediaThumbnail(ContentsMediaThumbnailId id,
			ContentsMedia contentsMedia, long archiveId,
			String thumbnailDetails,
			Set<ContentsDelegatedThumbnail> contentsDelegatedThumbnails)
	{
		this.id = id;
		this.contentsMedia = contentsMedia;
		this.archiveId = archiveId;
		this.thumbnailDetails = thumbnailDetails;
		this.contentsDelegatedThumbnails = contentsDelegatedThumbnails;
	}

	@EmbeddedId
	@AttributeOverrides(
	{
			@AttributeOverride(name = "thumbnailId", column = @Column(name = "ThumbnailId", nullable = false)),
			@AttributeOverride(name = "mediaId", column = @Column(name = "MediaId", nullable = false)) })
	public ContentsMediaThumbnailId getId()
	{
		return this.id;
	}

	public void setId(ContentsMediaThumbnailId id)
	{
		this.id = id;
	}

	@EntityIdNotNull(message = "validation.contents.contentsMediaThumbnail.contentsMedia.notNull")
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MediaId", nullable = false, insertable = false, updatable = false)
	public ContentsMedia getContentsMedia()
	{
		return this.contentsMedia;
	}

	public void setContentsMedia(ContentsMedia contentsMedia)
	{
		this.contentsMedia = contentsMedia;
	}

	@NotNull(message = "validation.contents.contentsMediaThumbnail.archiveId.notNull")
	@Column(name = "ArchiveId", nullable = false)
	public long getArchiveId()
	{
		return this.archiveId;
	}

	public void setArchiveId(long archiveId)
	{
		this.archiveId = archiveId;
	}

	@Max(message = "validation.contents.contentsMediaThumbnail.thumbnailDetails.max", value = 200)
	@Column(name = "ThumbnailDetails", length = 200)
	public String getThumbnailDetails()
	{
		return this.thumbnailDetails;
	}

	public void setThumbnailDetails(String thumbnailDetails)
	{
		this.thumbnailDetails = thumbnailDetails;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contentsMediaThumbnail")
	public Set<ContentsDelegatedThumbnail> getContentsDelegatedThumbnails()
	{
		return this.contentsDelegatedThumbnails;
	}

	public void setContentsDelegatedThumbnails(
			Set<ContentsDelegatedThumbnail> contentsDelegatedThumbnails)
	{
		this.contentsDelegatedThumbnails = contentsDelegatedThumbnails;
	}

}
